package com.neusoft.databus.sap.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.FilterType;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.annotation.EnableScheduling;

import com.neusoft.bizcore.common.annotation.EnableBizcoreCache;
import com.neusoft.bizcore.common.annotation.EnableBizcoreMessaging;
import com.neusoft.bizcore.common.annotation.EnableKafka0;
import com.neusoft.bizcore.schedule.annotition.EnableBizcoreSchedule;
import com.neusoft.bizcore.web.annotation.EnableBizcoreWebMVC;
import com.neusoft.databus.agent.DatabusAgentApplication;
import com.neusoft.databus.agent.controller.CommandController;
import com.neusoft.databus.agent.controller.SupportController;
import com.neusoft.databus.agent.service.CoreMicroService;
import com.neusoft.databus.core.DatabusCoreApplication;
import com.neusoft.databus.core.config.LoadBalanceConfiguration;
import com.neusoft.databus.core.controller.JobController;
import com.neusoft.databus.core.service.AgentMicroService;
import com.neusoft.databus.core.service.StatisticService;
import com.neusoft.databus.core.service.impl.JobExecutableDetermineServiceImpl;
import com.neusoft.databus.core.service.impl.MonitorDataDispatcherServiceIml;
import com.neusoft.databus.core.service.impl.MonitorDataServiceImpl;
import com.neusoft.databus.policy.DatabusPolicyApplication;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@EnableKafka0
@EnableBizcoreWebMVC
@EnableBizcoreMessaging
@EnableBizcoreCache
@EnableBizcoreSchedule
@SpringBootApplication
@EnableScheduling
//@EnableBizcoreLicense
@EnableAutoConfiguration(exclude = {KafkaAutoConfiguration.class })
@EntityScan({"com.neusoft.databus.core.model", "com.neusoft.databus.common.model", "com.neusoft.databus.policy.model" })
@ComponentScan(basePackages = {"com.neusoft.databus" }, excludeFilters = {
        @Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {DatabusCoreApplication.class,
                JobExecutableDetermineServiceImpl.class,
                LoadBalanceConfiguration.class, AgentMicroService.class, CoreMicroService.class, JobController.class,
                DatabusAgentApplication.class, CommandController.class, SupportController.class,
                com.neusoft.databus.core.controller.SupportController.class,
                DatabusPolicyApplication.class,
                MonitorDataDispatcherServiceIml.class,
                MonitorDataServiceImpl.class,
                StatisticService.class }) })

@EnableJpaRepositories(basePackages = "com.neusoft.databus")
public @interface DatabusSapConfiguration {

}
